import axios from '@/utils/request'

import config from '@/common/config'

let base = config.getMkBasePath();

/**
 * 商品提成规则表
 *1    默认只开放普通查询，所有查询，只要上传	 分页参数 {currentPage:当前页码从1开始,pageSize:每页记录数,total:总记录【数如果是0后台会自动计算总记录数非0不会自动计算】}，后台都会自动按分页查询 其它 api用到再打开，没用到的api请注释掉，
 *2 查询、新增、修改的参数格式  params={id:'主键 主键',goodsId:'商品id',goodsName:'商品名称',mkRule:'营销规则',mkPct:'百分比（销售金额提成百分比）',mkFee:'单品提成金额',locationId:'门店编号',shopId:'商户编号',oagent:'开启代理0否1是',odist:'开启分销0否1是',ogbuy:'开启团购0否1是',ofee:'开启销售分佣0否1是'}
 **/
 
//普通查询 条件之间and关系  
export const listGoodsRule = params => { return axios.get(`${base}/mk/mng/goods/goodsRule/list`, { params: params }); };

//模糊查询商品提成规则表 条件之间or关系  
//export const listGoodsRuleKey = params => { return axios.get(`${base}/mk/mng/goods/goodsRule/listKey`, { params: params }); };

//删除一条商品提成规则表 params={id:'主键 主键'}
export const delGoodsRule = params => { return axios.post(`${base}/mk/mng/goods/goodsRule/del`,params); };

//批量删除商品提成规则表  params=[{id:'主键 主键'}]
export const batchDelGoodsRule = params => { return axios.post(`${base}/mk/mng/goods/goodsRule/batchDel`, params); };

//修改一条商品提成规则表记录
export const editGoodsRule = params => { return axios.post(`${base}/mk/mng/goods/goodsRule/edit`, params); };
export const addBatch = params => { return axios.post(`${base}/mk/mng/goods/goodsRule/addBatch`, params); };
export const updateBatch= params => { return axios.post(`${base}/mk/mng/goods/goodsRule/updateBatch`, params); };
//新增一个
export const addGoodsRule = params => { return axios.post(`${base}/mk/mng/goods/goodsRule/add`, params); };